<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('组合统计查询')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: bootstrap-editable-css"/>
    <th:block th:include="include :: container-css"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-select-css"/>
</head>
<style>
    .fixed-table-container .bs-checkbox .th-inner {
        padding: 8px 8px !important;
    }

    .form-group {
        margin-right: 35px !important;
    }

    .select2 {
        width: 100% !important;
    }

    .noselect2 {
        width: 200px !important;
    }

    .select2-dropdown {
        z-index: 99999 !important;
    }


</style>
<body class="gray-bg">

<div class="modal inmodal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span>
                    </button>
                    <h4 class="modal-title">组合统计查询</h4>
                </div>

                <div class="modal-body">
                    <p>
                        查询维度1:
                    <div class="input-group date">
                        <select id="Xflag" class="form-control noselect2">
                            <option value="">请选择</option>
                            <option value="CompId">公司</option>
                            <option value="depId">部门</option>
                            <option value="EmpType">员工类别</option>
                            <option value="Gender">性别</option>
                            <option value="HighLevel">学历</option>
                            <option value="HighDegree">学位</option>
                            <option value="Party">政治面貌</option>
                            <option value="age">年龄</option>
                            <option value="Cyear">司龄</option>
                        </select>
                    </div>
                    </p>
                    <p>
                        查询维度2:
                    <div class="input-group date">
                        <select id="Yflag" class="form-control noselect2">
                            <option value="">请选择</option>
                            <option value="CompId">公司</option>
                            <option value="depId">部门</option>
                            <option value="EmpType">员工类别</option>
                            <option value="Gender">性别</option>
                            <option value="HighLevel">学历</option>
                            <option value="HighDegree">学位</option>
                            <option value="Party">政治面貌</option>
                            <option value="age">年龄</option>
                            <option value="Cyear">司龄</option>
                        </select>
                    </div>
                    </p>
                </div>
                <div class="modal-footer">
                    <button type="button" id="close" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" id="determine" onclick="getData()" class="btn btn-primary">确认</button>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>工号：</p>
                            <input type="text" name="badge"/>
                        </li>
                        <li>
                            <p>姓名：</p>
                            <input type="text" name="name"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>

</body>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: hr-help-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-select-js"/>

<script th:inline="javascript">
    var prefix = ctx + "empInfo/oftenQuery";


    $(function () {
        $("#myModal1").modal('show');
    });


    function getData() {
        var Xflag = $("#Xflag").val();
        var Yflag = $("#Yflag").val();

        var columns = [];
        $.ajax({
            async: false,
            url: prefix + "/findAllFieldByXflag",
            data: {
                "Xflag": Xflag
            },
            type: "post",
            dataType: "json",
            success: function (data) {
                var yzTitle = {field: 'yzTitle', title: ''};
                columns.push(yzTitle);
                for (var i = 0; i < data.length; i++) {
                    var other = {field: data[i], title: data[i]};
                    columns.push(other);
                }
                var options = {
                    url: prefix + "/zhtjStatistics?Xflag=" + Xflag + "&Yflag=" + Yflag,
                    height: $(window).height() - 120,
                    modalName: "组合统计查询",
                    pagination: false,
                    columns: columns
                };
                $.table.init(options);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });

        $("#close").click();
    }

</script>
</html>